import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs";
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/apartment"

//院系信息api
const apiStudentInfo = {
    //获取导入字段定义列表数据
    ImportList: function (search, order) {
        const data = {
            search, order
        }
        return request({
            url: baseUrl + '/importData/list',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //学生信息数据导入
    ImportCardMachineData: function (dataList, queryList, pageIndex, totalPages) {
        const data = {
            dataList, queryList, pageIndex, totalPages
        }
        return request({
            url: baseUrl + '/manageStudent/importStudentData',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //学生信息数据导入前数据验证
    ImportCardMachineDataValidate: function (dataList, queryList, pageIndex, totalPages) {
        const data = {
            dataList, queryList, pageIndex, totalPages
        }
        return request({
            url: baseUrl + '/manageStudent/importStudentDataValidate',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //获取管理中心-学生表(字段均为国标) 列表数据
    StuList: function (page, search, fields, order,) {
        const data = {

            page,
            search,
            fields,
            order,

        }
        return request({
            url: baseUrl + '/manageStudent/stuList',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //列表
    List: function (page, search, fields, order,) {
        const data = {

            page,
            search,
            fields,
            order,

        }
        return request({
            url: baseUrl + '/manageStudent/list',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //年级列表
    GradeList: function (id) {
        const data = {
            id
        }
        return request({
            url: baseUrl + '/manageStudent/gradeList',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //提取信息
    Get: function (id) {
        const data = {
            id
        }
        return request({
            url: baseUrl + '/manageStudent/get',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //编辑
    Save: function (data) {
        const config = {
            headers: { 'Content-Type': 'application/json;charset=utf-8' },
        }
        return request.post(baseUrl + '/manageStudent/save', data, config)
    },
    //删除
    Del: function (ids) {
        const data = {
            ids
        }
        return request({
            url: baseUrl + '/manageStudent/delete',
            method: 'post',
            data: qs.stringify(data)
        })
    },

}
export { apiStudentInfo }
